package com.ruoyi.project.mgcmanage.controller;

import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.framework.web.page.TableDataInfo;
import com.ruoyi.project.mgcmanage.domain.Purchase;
import com.ruoyi.project.mgcmanage.service.IPurchaseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/mgcmanage/audit")
public class AuditController extends BaseController {

    @Autowired
    private IPurchaseService iPurchaseService;

    @PreAuthorize("@ss.hasPermi('mgcmanage:audit:edit')")
    @PutMapping("/{noIds}")
    public AjaxResult changeStatus(@PathVariable int noIds){
        return toAjax(iPurchaseService.updateStatus(noIds));
    }


    @PreAuthorize("@ss.hasPermi('mgcmanage:audit:query')")
    @GetMapping
    public TableDataInfo getList( ){
        startPage();
        return getDataTable(iPurchaseService.getList2());
    }

    /*@GetMapping("/{noIds2}")
    public AjaxResult changStatus2(@PathVariable int noIds2){
        return toAjax(iPurchaseService.updateStatus2(noIds2));
    }*/
}
